home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / c / GED4DCC.lha / GoldED_ErrorMove.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-02-03  |  2.2 KB  |  94 lines

  1. /*
  2. ** $VER: GoldED_ErrorMove.rexx 1.001 (07.01.95) © Gian Maria Calzolari
  3. **
  4. **
  5. **  FUNCTION:
  6. **      DICE Error Parsing Script, must be called from within GoldEd and goes
  7. **          through the errors. Script for GoldEd © Dietemar Eilert
  8. **
  9. **      Commands:
  10. **          Current
  11. **          First
  12. **          Next
  13. **          Prev
  14. **
  15. ** Notes: Add this to a Function key (i.e. F1) as an Arexx cmd to always have
  16. **          it ready to use!
  17. **
  18. **        This assumes that your DCC:Config/DCC.Config file contains the
  19. **         following line:
  20. **
  21. **  cmd= rx DCC:Rexx/GoldED_ErrorParse.rexx %e "%c" "%f" "%0"
  22. **
  23. ** $HISTORY:
  24. **
  25. ** 07 Jan 1995 : 001.001 : First release. Created by Gian Maria Calzolari
  26. **                          (2:332/502.11 2:332/801.19)
  27. **
  28. */
  29.  
  30. OPTIONS RESULTS
  31.  
  32. parse upper arg COMMAND
  33.  
  34. portname = 'DICE_ERROR_PARSER'  /* DICEHelp's port name */
  35.  
  36. /*
  37. ** do nothing if the error parser isn't loaded!
  38. */
  39.  
  40. if ~show('p',portname) then exit
  41.  
  42. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then address 'GOLDED.1'
  43.  
  44. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  45. OPTIONS FAILAT 6                            /* ignore warnings         */
  46. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  47.  
  48. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  49.  
  50. /*
  51. ** Get info on the next error
  52. */
  53.  
  54. ADDRESS DICE_ERROR_PARSER COMMAND E
  55.  
  56. IF rc ~= 0 THEN DO
  57.     'REQUEST PROBLEM="No More Errors"'
  58.     'UNLOCK' /* VERY important: unlock GUI */
  59.     EXIT
  60. END
  61.  
  62. IF E.LINE = 0 THEN DO
  63.  
  64.     IF LEFT(E.TEXT, 5) = 'DLINK' THEN DO
  65.         /* This is a DLINK error, we need to handle it special */
  66.         TT = TRANSLATE(E.STRING, '-', '"')
  67.         'REQUEST PROBLEM="There were DLINK Errors' TT '"'
  68.         'UNLOCK' /* VERY important: unlock GUI */
  69.         EXIT
  70.     END
  71.  
  72. END
  73.  
  74. 'QUERY DOC'
  75.  
  76. if (result ~= E.FPATH) then 'OPEN NAME' E.FPATH SMART
  77.  
  78. 'GOTO LINE'     E.LINE              /* Jump straight to the line number. */
  79. 'GOTO COLUMN'   E.COL               /* Jump straight to the column number. */
  80.  
  81. 'REQUEST PROBLEM="' || E.ERRNO E.STRING || '"'
  82.  
  83. /* ---------------------------- END OF YOUR CODE --------------------- */
  84.  
  85. 'UNLOCK' /* VERY important: unlock GUI */
  86. EXIT
  87.  
  88. SYNTAX:
  89.  
  90. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  91. 'UNLOCK'
  92. EXIT
  93.  
  94.